package dayone;

import java.util.Scanner;

public class pra6 {

        //编写程序：从键盘上读入一个学生成绩，存放在变量score中，根据score的值输出其对应的成绩等级：
//
//score>=90           等级:  A
//70<=score<90        等级:  B
//60<=score<70        等级:  C
//score<60            等级:  D
//方式二：使用switch-case:  score / 10:   0 - 10
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入学生成绩");
            int score = scanner.nextInt();
            char grade='V' ;
            switch (score / 10) {
                case 10, 9:
                    grade = 'A';
                    break;
                case 8, 7:
                    grade = 'B';
                    break;
                case 6:
                    grade = 'C';
                    break;
                case 5, 4, 3, 2, 1, 0:
                    grade = 'D';
                    break;
            }
            System.out.println("学生的成绩等级为"+ grade);
            scanner.close();
        }
    }
